<?php

require_once('php/lib/mvc/controller.php');
config('ErrorController', 'error_controller');

	class ErrorController extends Controller {

		function init() {
			require_once('php/views/yapter_view.php');
		}
		
		function generrorpage() {
			require('php/config/error.php');
			$view = new YapterView('content/error.tpl');
			
			printr($_GET);
			
			if (isset($_GET['dberror']) || isset($_GET['errormessage'])){
				$view->set('failcode', $_GET['errormessage']);
				if ($_GET['dberror'] != null) {
					$view->set('failmessage', $_GET['dberror']);
				} else {
					$view->set('failmessage', $error[$_GET['errormessage']]);	
				}
			
			} else {
				$view->set('failmessage', "unknown");
				$view->set('failcode', "unknown");
			}
			
			return $view;
		}
	
	}

?>